<?php
// check if admin logged 
session_start();

include "config.php";

// mysql connect
mysql_connect("$host", "$user", "$pass") or die(mysql_error());
mysql_select_db("$db") or die(mysql_error());


// includes classes
include "classes.php";
$check = new Check();
$jQuery = new jQuery();

// makes the ?page=***** links
$page = (isset($_GET['page']))?str_replace('.', '', $_GET['page']):'start'; 
if(!file_exists('pages/'.$page.'.php') ) $page = 'error'; 
include 'pages/'.$page.'.php'; 

// jquery path
$jquery = '
<link type="text/css" href="'.$config['path'].'jQuery/css/custom-theme/jquery-ui-1.8.7.custom.css" rel="stylesheet" />	
<script type="text/javascript" src="'.$config['path'].'jQuery/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="'.$config['path'].'jQuery/js/jquery-ui-1.8.7.custom.min.js"></script>
';

// includes the template
include 'templates/'.$config['template'].'/index.php';
?>